
class String
  def nest()
    nested_str = self.gsub( "\\", "\\\\\\\\" ) # \ -> \\
    nested_str = nested_str.gsub( "\"", "\\\"" ) # " -> \"

    return nested_str
  end
end

# \" -> \\\"
# " -> \"